<?php

namespace App\Http\Requests;

class ResetRequest extends BaseRequest {
    /**
     * Get the validation rules that apply to the request.
     * @return string[]
     */
    public function rules(): array
    {
        return [
            'password' => 'required|string',
            'mobile' => 'required|regex:/^1[0-9]{10}$/',
            'code' => 'required',
        ];
    }

    public function messages(): array
    {
        return [
            'password.regex' => '密码不能为空',
            'mobile.required' => '手机号不能为空',
            'mobile.regex' => '手机号格式不正确',
            'code.required' => '验证码不能为空',
        ];
    }
}
